package com.kymatrix.mpo.plus.bpm.server.model.form.group;

import com.kymatrix.mpo.plus.bpm.server.model.entity.definition.BpmUserGroupEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.Set;
import lombok.Data;
import lombok.experimental.Accessors;

@ApiModel(value = "管理后台 - 用户组 Response")
@Data
@Accessors(chain=true)
public class QueryBpmUserGroupResp {

    @ApiModelProperty(value = "编号", example = "1024")
    private String id;

    @ApiModelProperty(value = "组名", example = "zhangsan")
    private String name;

    @ApiModelProperty(value = "描述", example = "zhangsan源码")
    private String description;

    @ApiModelProperty(value = "成员编号数组", example = "1,2,3")
    private Set<String> userIds;

    @ApiModelProperty(value = "状态 EnableType", example = "1")
    private String status;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;
    
    public static QueryBpmUserGroupResp fromEntity(BpmUserGroupEntity entity) {
        if (entity == null) {
            return null;
        }
        QueryBpmUserGroupResp resp = new QueryBpmUserGroupResp();
        resp.setId(entity.getId());
        resp.setName(entity.getName());
        resp.setDescription(entity.getDescription());
        resp.setUserIds(entity.getUserIds());
        resp.setStatus(entity.getStatus());
        resp.setCreateTime(entity.getCreateTime());
        return resp;
    }

}
